#include "custom_tree_widget.h"

CustomTreeWidgetItem::CustomTreeWidgetItem(QTreeWidget *parent) : QTreeWidgetItem(parent)
{

}

CustomTreeWidgetItem::CustomTreeWidgetItem(CustomTreeWidgetItem* parent) : QTreeWidgetItem(parent)
{

}

bool CustomTreeWidgetItem::operator<(const QTreeWidgetItem &other) const
{
    int column = treeWidget()->sortColumn();
    if (column == 1)
    {
        QString thisText = this->text(column);
        QString otherText = other.text(column);
        return thisText.toDouble() < otherText.toDouble();
    }
    else
    {
        return QTreeWidgetItem::operator<(other);
    }
}
